import axiosInstance from '@/utils/request'

// 获取订单列表，待支付，待发货，待收货等
export const getOrderListApi = (dataType, page) => {
  return axiosInstance.get('/order/list', {
    params: {
      dataType, // 订单类型
      page // 页数
    }
  })
}

// 取消订单
export const cancelOrderApi = (orderId) => {
  return axiosInstance.post('/order/cancel', {
    orderId
  })
}

// 确认收货
export const receiptOrderApi = (orderId) => {
  return axiosInstance.post('/order/receipt', {
    orderId
  })
}

// 订单支付
export const payOrderApi = (orderId) => {
  return axiosInstance.post('/order/pay', {
    orderId,
    payType: '10', // 余额支付
  })
}

// 订单详情
export const getOrderDetailApi = (orderId) => {
  return axiosInstance.post('/order/detail', {
    orderId,
  })
}
